package com.cjb.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 操作日志表
 * </p>
 *
 * @author kuangjian
 * @since 2022-08-30
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("tb_log")
@ApiModel(value = "Log对象", description = "操作日志表")
public class Log extends Model<Log> {

    @ApiModelProperty("日志ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("操作用户")
    @TableField("username")
    private String username;

    @ApiModelProperty("操作内容")
    @TableField("operation")
    private String operation;

    @ApiModelProperty("耗时")
    @TableField("time")
    private BigDecimal time;

    @ApiModelProperty("操作方法")
    @TableField("method")
    private String method;

    @ApiModelProperty("方法参数")
    @TableField("params")
    private String params;

    @ApiModelProperty("操作者IP")
    @TableField("ip")
    private String ip;

    @ApiModelProperty("创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @ApiModelProperty("操作地点")
    @TableField("location")
    private String location;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
